//
//  CMSChartsContainerModel.m
//  CMSCharts
//
//  Created by symbio on 2023/2/17.
//

#import "CMSChartsContainerModel.h"

@implementation CMSChartsContainerModel

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.tagTitles = @[@"上证指数", @"不复权", @"BIAS", @"上证指数", @"不复权", @"BIAS"];
        self.attributedString = [[NSMutableAttributedString alloc] initWithString:@"123456789123456789123456789123456789123456789123456789123456789123456789123456789123456789" attributes:@{NSForegroundColorAttributeName:[UIColor blackColor], NSFontAttributeName:[UIFont systemFontOfSize:10]}];
    }
    return self;
}

- (double)backAmoutCountOfChart:(CMSChartsType)chartType {
    
    switch (chartType) {
        case CMSChartsTypeTimeHK:
            return CMSCountHK;
        case CMSChartsTypeTimeSummerUS:
            return CMSCountSummerUS;
        case CMSChartsTypeTimeWinterUS:
            return CMSCountWinterUS;
        case CMSChartsTypeTimeEU:
            return CMSCountEU;
        default:
            return CMSCountCN;
    }
    
}

- (NSArray *)backXPositionArrayForType:(CMSChartsType)chartType {
    
    switch (chartType) {
        case CMSChartsTypeTimeHK:
            return @[@80, @150, @240];
        case CMSChartsTypeTimeSummerUS:
            return @[@96, @291];
        case CMSChartsTypeTimeWinterUS:
            return @[@96, @291];
        case CMSChartsTypeTimeSharing:
        {
            double perNumber = CMSCountCN / 4;
            return @[@(perNumber), @(perNumber*2), @(perNumber*3)];
        }
        case CMSChartsTypeFiveDay:
        {
            double perNumber = CMSCountCN / 5;
            return @[@(perNumber), @(perNumber*2), @(perNumber*3), @(perNumber*4)];
        }
        default:
            return @[];
    }
    
}

@end
